﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Cofe.Core.Validater;

namespace Cofe.Core
{
    public class PropertyPairDouble : PropertyPair
    {
        public double ORMValue { get { return base.Value is double ? (double)base.Value : 0; } set { base.Value = value; } }
    }

    public class PropertyPairInt32 : PropertyPair
    {
        public Int32 ORMValue { get { return base.Value is Int32 ? (Int32)base.Value : 0; } set { base.Value = value; } }
    }

    public class PropertyPairInt16 : PropertyPair
    {
        public Int16 ORMValue { get { return base.Value is Int16 ? (Int16)base.Value : (Int16)0; } set { base.Value = value; } }
    }

    public class PropertyPairInt64 : PropertyPair
    {
        public Int64 ORMValue { get { return base.Value is Int64 ? (Int64)base.Value : 0; } set { base.Value = value; } }
    }


    public class PropertyPairString : PropertyPair
    {
        public string ORMValue { get { return base.Value is string ? (string)base.Value : ""; } set { base.Value = value; } }
    }

    public class PropertyPairBool : PropertyPair
    {
        public bool ORMValue { get { return base.Value is bool ? (bool)base.Value : false; } set { base.Value = value; } }
    }

    public class PropertyPairDateTime : PropertyPair
    {
        public DateTime ORMValue { get { return base.Value is DateTime ? (DateTime)base.Value : CofeConstants.MinDateTime; } set { base.Value = value; } }
    }

    public class PropertyPairGuid : PropertyPair
    {
        public Guid ORMValue { get { return base.Value is Guid ? (Guid)base.Value : Guid.Empty; } set { base.Value = value; } }
    }

    public class PropertyPairByteArray : PropertyPair
    {
        public byte[] ORMValue { get { return base.Value is byte[] ? (byte[])base.Value : new byte[] { }; } set { base.Value = value; } }
    }
}
